package hello.rest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.messaging.simp.annotation.SendToUser;
import org.springframework.web.bind.annotation.RestController;

import hello.entity.OneToOne;

@RestController
public class OneToOneController {

	public static Integer userNum = 0; //模拟用户的个数
	
	@Autowired 
	private SimpMessagingTemplate template;
	
    @MessageMapping("/singleSend")
    @SendToUser(value="/topic/singleSend",broadcast=false)
	public OneToOne singleSend(OneToOne one){
		return one;
	}
}
